﻿<UserControl x:Class="BetterNetwork.Views.AppView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
             mc:Ignorable="d" Width="737">
    <Grid RenderTransformOrigin="0.502,1.009" Height="430">
        <Grid.Resources>
            <Style x:Key="HyperlinkButton" TargetType="Button">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <ContentPresenter/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="514*"/>
            <ColumnDefinition Width="223*"/>
        </Grid.ColumnDefinitions>

        <StackPanel Grid.Row="0" Grid.Column="0" Margin="0,19,0,0">
            <Label Content="Network Lists" Margin="10,0,0,0"/>
            <ListView x:Name="NetworkProfiles" Height="168" Margin="10,0">
                <ListView.View>
                    <GridView>
                        <GridViewColumn>
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <CheckBox>
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="Checked">
                                                <cal:ActionMessage MethodName="NetworkChecked">
                                                    <cal:Parameter Value="$eventArgs" />
                                                </cal:ActionMessage>
                                            </i:EventTrigger>
                                            <i:EventTrigger EventName="Unchecked">
                                                <cal:ActionMessage MethodName="NetworkUnchecked">
                                                    <cal:Parameter Value="$eventArgs" />
                                                </cal:ActionMessage>
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </CheckBox>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="Profile" DisplayMemberBinding="{Binding Name}" Width="auto"/>
                        <GridViewColumn Header="Profile Guid" DisplayMemberBinding="{Binding ProfileGuid}" Width="auto"/>
                        <GridViewColumn Header="Signature" DisplayMemberBinding="{Binding ManageType}" Width="auto"/>
                    </GridView>
                </ListView.View>
            </ListView>
        </StackPanel>

        <StackPanel Grid.Row="1" Grid.Column="0">
            <Label Content="Interface Profiles" Margin="10,0,0,0"/>
            <ListView x:Name="InterfaceProfiles" HorizontalAlignment="Right" Height="172" Width="494" Margin="0,0,10,0">
                <ListView.View>
                    <GridView>
                        <GridViewColumn>
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <CheckBox>
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="Checked">
                                                <cal:ActionMessage MethodName="InterfaceChecked">
                                                    <cal:Parameter Value="$eventArgs" />
                                                </cal:ActionMessage>
                                            </i:EventTrigger>
                                            <i:EventTrigger EventName="Unchecked">
                                                <cal:ActionMessage MethodName="InterfaceUnchecked">
                                                    <cal:Parameter Value="$eventArgs" />
                                                </cal:ActionMessage>
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </CheckBox>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="Profile" DisplayMemberBinding="{Binding Name}" Width="auto"/>
                        <GridViewColumn Header="Profile Guid" DisplayMemberBinding="{Binding ProfileGuid}" Width="auto"/>
                        <GridViewColumn Header="Interface Guid" DisplayMemberBinding="{Binding InterfaceGuid}" Width="auto"/>
                    </GridView>
                </ListView.View>
            </ListView>
        </StackPanel>

        <GroupBox Grid.Column="1" Header="Settings" HorizontalAlignment="Left" Margin="10,44,0,0" VerticalAlignment="Top" Height="58" Width="196">
            <StackPanel Width="191">
                <RadioButton Name="ThirtyTwoBitChecked" Content="32-bit system"/>
                <RadioButton Name="SixtyFourBitChecked" Content="64-bit system" IsChecked="True"/>
            </StackPanel>
        </GroupBox>
        <Button Name="LoadAll" Content="Load All" 
                Grid.Column="1" HorizontalAlignment="Left" Margin="10,116,0,0" VerticalAlignment="Top" Width="96" Height="20"/>
        <Button x:Name="Delete" Content="Delete" Grid.Column="1" HorizontalAlignment="Left" Margin="110,116,0,0" VerticalAlignment="Top" Width="96" Height="20"/>
        <!--http://stackoverflow.com/questions/4757780/bind-method-on-click-event-of-labellink-control-in-wpf-caliburn/13587615#13587615-->
        <Button Style="{StaticResource HyperlinkButton}" Focusable="False"
            cal:Message.Attach="[Event Click] = [Action About]" Grid.Column="1" Margin="178,185,0,0" Height="20" VerticalAlignment="Top" Grid.Row="1">
            <TextBlock Height="20" VerticalAlignment="Top">
                <Hyperlink Focusable="False">About</Hyperlink>
            </TextBlock>
        </Button>
        <Button Style="{StaticResource HyperlinkButton}" Focusable="False"
        cal:Message.Attach="[Action NavigateTo()]" Grid.Column="1" Margin="117,186,60,10" Grid.Row="1">
            <TextBlock Margin="10,-1,-10,0" Height="18" VerticalAlignment="Top">
            <Hyperlink Focusable="False">Donate</Hyperlink>
            </TextBlock>
        </Button>
    </Grid>
</UserControl>
